
var checkTag=0;

$(document).ready(function () {
	findCurrentEvent();
});

function findCurrentEvent(){	
	var timestamp = Date.parse(new Date());
	$.get("admin/LZMCurrentEvent_findCurrentEvent.action?ts="+timestamp,null,findCurrentEventRst);
}

function findCurrentEventRst(data){
	//$('#currentEventList').val(data.ajaxRst);
	$.each(data.currentEvents,function(i,n){
		//alert("SDFDSF");
		//alert(n.EId);
		//alert(n.tbEvent.EEventname);
		fillDatatoHTML(n.tbEvent.EEventname,n.EId);
	});
	var strhtml="";		
	strhtml+="<tr><td width='100%' height='18' bgcolor='#FFFFFF'><div align='center' class='STYLE1'>&nbsp;";
	strhtml+="</div></td></tr>";
	$('#currentEventList').append(strhtml);	
}

function ent(){
	//alert("dfg");
	//var item = $("input[@name=event][@checked]").val();
	//alert($("input[type='radio']:checked").val());
	window.location.href="zhh/chat/chatIndex.jsp?eventId="+$("input[type='radio']:checked").val();
}

/**
 * DOM操作，动态生成HTML来显示内容
 */
function fillDatatoHTML(EEventname,EId){	
	var strhtml="";		
	strhtml+="<tr><td width='100%' height='18' bgcolor='#FFFFFF'><div align='center' class='STYLE1'>";
	if(checkTag==0){
		strhtml+="<input name='event' type='radio' value=";
		//alert(EId);
		strhtml+=EId;
		strhtml+=" checked='checked' />";
		checkTag=1;
	}else{
		//strhtml+="<input name='radio' type='radio' value='radio' />";
		strhtml+="<input name='event' type='radio' value=";
		strhtml+=EId;
		strhtml+=" />";
	}	
	strhtml+=EEventname;
	strhtml+="</div></td></tr>";
	$('#currentEventList').append(strhtml);			
}